// pages/workService/orderdetails/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    orderList: {
      peoplesname: "小明12345678910",
      address: "广东省广州市番禺区华南农业大学5号楼",
      studentnumber: "广东省广州市番禺区华南农业大学5号楼",
      createtime: "2018-01-01 08:11:11",
      orderstatus: "正在办理",
      order: "12345678910",
      orderbey: "更新中",
      filename: "中文成绩单",
      filenumber: "5",
      money: "5",
      express: "10",
      serversmoney: "5",
      countprice: "20"
    },
    detailList: [],
    sideNoList: [],
    orderListone: "待付款",
    orderListwo: "待发货",
    orderListhree: "待收货",
    orderListfour: "待评价",
    status: '',   //办理状态
    deliverNo: '',  //快递订单号
    goodsName: '',
    toAddress: '',   //地址
    pricevince: "",
    userId: '',
    gmtCreate: '',  //申请时间
    goodsPrice: '',
    goodsQuantity: '',
    deliveryCharge: '',
    otherCharge: '',
    needPayAmount: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      deliverNo: options.deliverNo,
      pricevince: options.pricevince
    })
    this.getwaybillquery();
    console.log(this.data.deliverNo, "拿到快递单号数据bbbb");
    wx.getStorage({      //小程序获取Storage存储的数据
      key: 'userInfo',
      success: (res) => {
        this.setData({
          userId: res.data.userId
        })
        // this.orderDetail();
      }

    })

  },


  getwaybillquery () {
    // paymentList: response.data[0].orderGoodsList,
    // needPayAmount: response.data[0].needPayAmount,
    // deliveryCharge: response.data[0].deliveryCharge,
    // otherCharge: response.data[0].otherCharge,
    const request = {
      deliverNo: this.data.deliverNo
    }
    wx.$API['workService/waybillquery'](request).then((response) => {
      console.log(response, "拿到接口列表");
      // this.detailList=response.data;
      this.setData({
        detailList: response.data,
        // sideNoList: response.data
      })
    }).catch((error) => {

    })
  },
  copy (e) {
    var that = this;
    console.log(e);
    wx.setClipboardData({
      data: that.data.deliverNo,
      success: function (res) {
        wx.showToast({
          title: '复制成功',
        });
      }
    });
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})